<!-- page heading start-->
<div class="page-heading ng-scope">
	<ul class="breadcrumb">
		<li><a href="#"> 首页 </a></li>
		<li><a href="javascript:void(0);"> 信息发布</a></li>
		<li class="active"> 信息列表</li>
	</ul>
</div>
<!-- page heading end-->
<div class="row">
    <div class="col-lg-12">
        <section class="panel">
            <header class="panel-heading"> 
           		<span ng-if="context.id != null" > 编辑文章 </span>
            	<span ng-if="context.id == null" > 添加文章 </span>
            </header>
            <div class="panel-body">
                <form class="form-horizontal" role="form" name="myForm" id="contextForm" enctype="multipart/form-data">
					<input type="text" ng-hide="true" ng-model="context.id" name="id">
                    <div class="form-group">
                        <label for="inputTypeName" class="col-lg-2 col-sm-2 control-label">文章标题</label>
                        <div class="col-lg-10">
                            <input type="text" ng-hide="true" ng-model="context.id" name="context.id">
						<input type="text" ng-model="context.c_title" name="cTitle" class="form-control" ng-required="true" ng-maxlength="32" ng-minlength="2" placeholder="请输入文章标题">
						<div ng-show="myForm.cTitle.$dirty && myForm.cTitle.$error.minlength" class="alert alert-danger help-block">
							至少要输入2个字符
						</div>
						<div ng-show="myForm.cTitle.$dirty && myForm.cTitle.$error.maxlength" class="alert alert-danger help-block">
							不能超过32个字符
						</div>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label for="inputTypeValue" class="col-sm-2 control-label">文章分类</label>
                        <div class="col-lg-10">
							<select ng-model="context.channal_id" name="channal_id" class="form-control"
								ng-options="channal.id as channal.c_name for channal in channalList">
								<option value="">请选择</option>
							</select>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label for="inputTypeValue" class="col-lg-2 col-sm-2 control-label">作者</label>
                        <div class="col-lg-10">
                            <input type="text" ng-model="context.c_author" name="cAuthor" ng-required="true" class="form-control" ng-maxlength="16" ng-minlength="2" placeholder="请输入作者">
							<div ng-show="myForm.cAuthor.$dirty && myForm.cAuthor.$error.maxlength" class="alert alert-danger help-block">
								不能超过16个字符
							</div> 
							<div ng-show="myForm.cAuthor.$dirty && myForm.cAuthor.$error.minlength" class="alert alert-danger help-block">
								至少输入2个字符
							</div>
                        </div>
                    </div>
				
                    <div class="form-group">
                        <label for="inputTypeValue" class="col-lg-2 col-sm-2 control-label">是否置顶</label>
                        <div class="col-lg-10">
								<label class="radio-inline" ng-init="context.c_is_top = 1">
								<input type="radio" ng-model="context.c_is_top" ng-checked="true" name="isTop" value="1"/>是
								</label>
								<label class="radio-inline">
									<input type="radio" ng-model="context.c_is_top" name="isTop" value="0"/>否
								</label>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label for="inputTypeValue" class="col-lg-2 col-sm-2 control-label">是否热门</label>
	                     <div class="col-lg-10">
	                            <label class="radio-inline" ng-init="context.c_is_hot = 1">
									<input type="radio" ng-model="context.c_is_hot" ng-checked="true" name="isHot" value="1"/>是
								</label>
								<label class="radio-inline">
									<input type="radio" ng-model="context.c_is_hot" name="isHot" value="0"/>否
								</label>
	                     </div>
					</div>
					
					<div class="form-group">
                        <label class="col-lg-2 col-sm-2 control-label">图片上传</label>
                        <div class="col-lg-10">
							<div class="htmleaf-container">
	                            <div class="kv-main">
									<input id="file" class="file" type="file">
								</div>
							</div>
                        </div>
                    </div>
                     <!-- 修改最少输入至少100个字符 修改时间2017/05/23 yanglj 文章分类默认提示被人修改 没有了-->
                    <div class="form-group">
                        <label for="inputTypeValue" class="col-lg-2 col-sm-2 control-label">文章内容</label>
                        <div class="col-lg-10">
						<textarea ck-editor ng-model="context.c_context" name="cCo" ng-required="true" ng-maxlength="2000" ng-minlength="110"></textarea>
                            <div ng-show="myForm.cCo.$dirty && myForm.cCo.$invalid" class="alert alert-danger help-block">
							至少100字，最多2000字
							</div>
                        </div>
                    </div>
				
                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-10">
                        	<button type="submit" class="btn btn-danger" ng-disabled="myForm.$invalid" ng-click="context.id !=null ? update() : save()">保存</button>
							<button type="button" class="btn btn-default" ng-click="back(id)">取消</button>
                        </div>
                    </div>
                    
                </form>
            </div>
        </section>
    </div>
</div>
